<?php

namespace App\Models\Admin;

use App\Models\BaseModel;
class MenuModel extends BaseModel
{

    /**
     * 左侧导航栏表
     * @var string
     */
    protected $table = 'admin_menu';

    /**
     * 主键是否主动递增
     *
     * @var bool
     */
    public $incrementing = false;

    /**
     * 不可批量赋值属性
     *
     * @var array
     */
    protected $guarded = ['id'];
    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = [
      'deleted_at','created_at','updated_at','laravel_through_key'
    ];

    public function children($class = MenuModel::class)
    {
      return $this->hasMany($class, 'parent', 'id');
    }


}
